import React, {Component} from 'react'
import Children from './Children'

class ParentTest extends Component {
    constructor(props) {
        super(props);
        this.onRefs = this.onRefs.bind(this);
        this.click = this.click.bind(this);
    }

    onRefs(ref) {
        this.child = ref
    }

    click() {
        this.child.myName();
    }


    render() {
        return (
            <div>
                <Children onRefs={this.onRefs}/>
                <button onClick={this.click}>测试</button>
            </div>
        );
    }
}

export default ParentTest